package com.lsa.letcode.the10.longestPalindromic;


import org.junit.Assert;
import org.junit.Test;

public class LongestPalindromicTest {
	@Test
	public void test() {
		Solution s = new Solution();
		
		//xxxabcdcbax
		//01234567890
		Assert.assertEquals("xabcdcbax", s.longestPalindrome("xxxabcdcbax"));
		Assert.assertEquals("xxxabcdcbaxxx", s.longestPalindrome("xxxabcdcbaxxx"));
		Assert.assertEquals("xxabcdcbaxx", s.longestPalindrome("xxxabcdcbaxxbcdcbzcdcyd"));
		Assert.assertEquals("x", s.longestPalindrome("x"));
		Assert.assertEquals("xx", s.longestPalindrome("xx"));
		Assert.assertEquals("xxx", s.longestPalindrome("xxx"));
		Assert.assertEquals("xxx", s.longestPalindrome("axxx"));
		Assert.assertEquals("xxx", s.longestPalindrome("xxxb"));
		Assert.assertEquals("xxx", s.longestPalindrome("axxxb"));
		Assert.assertEquals("zzzz", s.longestPalindrome("axxxbyyyyczzzzd"));
	}
	
//	@Test
	public void mmain() {
//		int size = 6;
//		for (int l = 2; l < size; l++) {
//			for (int i = 0; i < size - l + 1; i++) {
//				int j =  l + i - 1;
//				System.out.println(String.format("(%s,%s)", i, j));
//			}
//		}
		
		int from = 0;
		int to = 5;
		int size = to - from + 1;
		for (int l = 2; l <= size; l++) {
			for (int i = from; i < size - l + 1; i++) {
				int j =  l + i - 1;
				System.out.println(String.format("(%s,%s)", i, j));
			}
		}
	}
}